(0) Obligation:
Runtime Complexity TRS:
The TRS R consists of the following rules:
car(cons(x, l)) → x
cddr(nil) → nil
cddr(cons(x, nil)) → nil
cddr(cons(x, cons(y, l))) → l
cadr(cons(x, cons(y, l))) → y
isZero(0) → true
isZero(s(x)) → false
plus(x, y) → ifplus(isZero(x), x, y)
ifplus(true, x, y) → y
ifplus(false, x, y) → s(plus(p(x), y))
times(x, y) → iftimes(isZero(x), x, y)
iftimes(true, x, y) → 0
iftimes(false, x, y) → plus(y, times(p(x), y))
p(s(x)) → x
p(0) → 0
shorter(nil, y) → true
shorter(cons(x, l), 0) → false
shorter(cons(x, l), s(y)) → shorter(l, y)
prod(l) → if(shorter(l, 0), shorter(l, s(0)), l)
if(true, b, l) → s(0)
if(false, b, l) → if2(b, l)
if2(true, l) → car(l)
if2(false, l) → prod(cons(times(car(l), cadr(l)), cddr(l)))
Rewrite Strategy: FULL
(1) RenamingProof (EQUIVALENT transformation)
Renamed function symbols to avoid clashes with predefined symbol.
(2) Obligation:
Runtime Complexity Relative TRS:
The TRS R consists of the following rules:
car(cons(x, l)) → x
cddr(nil) → nil
cddr(cons(x, nil)) → nil
cddr(cons(x, cons(y, l))) → l
cadr(cons(x, cons(y, l))) → y
isZero(0') → true
isZero(s(x)) → false
plus(x, y) → ifplus(isZero(x), x, y)
ifplus(true, x, y) → y
ifplus(false, x, y) → s(plus(p(x), y))
times(x, y) → iftimes(isZero(x), x, y)
iftimes(true, x, y) → 0'
iftimes(false, x, y) → plus(y, times(p(x), y))
p(s(x)) → x
p(0') → 0'
shorter(nil, y) → true
shorter(cons(x, l), 0') → false
shorter(cons(x, l), s(y)) → shorter(l, y)
prod(l) → if(shorter(l, 0'), shorter(l, s(0')), l)
if(true, b, l) → s(0')
if(false, b, l) → if2(b, l)
if2(true, l) → car(l)
if2(false, l) → prod(cons(times(car(l), cadr(l)), cddr(l)))
S is empty.
Rewrite Strategy: FULL
(3) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)
Infered types.
(4) Obligation:
TRS:
Rules:
car(cons(x, l)) → x
cddr(nil) → nil
cddr(cons(x, nil)) → nil
cddr(cons(x, cons(y, l))) → l
cadr(cons(x, cons(y, l))) → y
isZero(0') → true
isZero(s(x)) → false
plus(x, y) → ifplus(isZero(x), x, y)
ifplus(true, x, y) → y
ifplus(false, x, y) → s(plus(p(x), y))
times(x, y) → iftimes(isZero(x), x, y)
iftimes(true, x, y) → 0'
iftimes(false, x, y) → plus(y, times(p(x), y))
p(s(x)) → x
p(0') → 0'
shorter(nil, y) → true
shorter(cons(x, l), 0') → false
shorter(cons(x, l), s(y)) → shorter(l, y)
prod(l) → if(shorter(l, 0'), shorter(l, s(0')), l)
if(true, b, l) → s(0')
if(false, b, l) → if2(b, l)
if2(true, l) → car(l)
if2(false, l) → prod(cons(times(car(l), cadr(l)), cddr(l)))
Types:
car :: cons:nil → 0':s
cons :: 0':s → cons:nil → cons:nil
cddr :: cons:nil → cons:nil
nil :: cons:nil
cadr :: cons:nil → 0':s
isZero :: 0':s → true:false
0' :: 0':s
true :: true:false
s :: 0':s → 0':s
false :: true:false
plus :: 0':s → 0':s → 0':s
ifplus :: true:false → 0':s → 0':s → 0':s
p :: 0':s → 0':s
times :: 0':s → 0':s → 0':s
iftimes :: true:false → 0':s → 0':s → 0':s
shorter :: cons:nil → 0':s → true:false
prod :: cons:nil → 0':s
if :: true:false → true:false → cons:nil → 0':s
if2 :: true:false → cons:nil → 0':s
hole_0':s1_0 :: 0':s
hole_cons:nil2_0 :: cons:nil
hole_true:false3_0 :: true:false
gen_0':s4_0 :: Nat → 0':s
gen_cons:nil5_0 :: Nat → cons:nil
(5) OrderProof (LOWER BOUND(ID) transformation)
Heuristically decided to analyse the following defined symbols:
plus,
times,
shorter,
prodThey will be analysed ascendingly in the following order:
plus < times
times < prod
shorter < prod
(6) Obligation:
TRS:
Rules:
car(
cons(
x,
l)) →
xcddr(
nil) →
nilcddr(
cons(
x,
nil)) →
nilcddr(
cons(
x,
cons(
y,
l))) →
lcadr(
cons(
x,
cons(
y,
l))) →
yisZero(
0') →
trueisZero(
s(
x)) →
falseplus(
x,
y) →
ifplus(
isZero(
x),
x,
y)
ifplus(
true,
x,
y) →
yifplus(
false,
x,
y) →
s(
plus(
p(
x),
y))
times(
x,
y) →
iftimes(
isZero(
x),
x,
y)
iftimes(
true,
x,
y) →
0'iftimes(
false,
x,
y) →
plus(
y,
times(
p(
x),
y))
p(
s(
x)) →
xp(
0') →
0'shorter(
nil,
y) →
trueshorter(
cons(
x,
l),
0') →
falseshorter(
cons(
x,
l),
s(
y)) →
shorter(
l,
y)
prod(
l) →
if(
shorter(
l,
0'),
shorter(
l,
s(
0')),
l)
if(
true,
b,
l) →
s(
0')
if(
false,
b,
l) →
if2(
b,
l)
if2(
true,
l) →
car(
l)
if2(
false,
l) →
prod(
cons(
times(
car(
l),
cadr(
l)),
cddr(
l)))
Types:
car :: cons:nil → 0':s
cons :: 0':s → cons:nil → cons:nil
cddr :: cons:nil → cons:nil
nil :: cons:nil
cadr :: cons:nil → 0':s
isZero :: 0':s → true:false
0' :: 0':s
true :: true:false
s :: 0':s → 0':s
false :: true:false
plus :: 0':s → 0':s → 0':s
ifplus :: true:false → 0':s → 0':s → 0':s
p :: 0':s → 0':s
times :: 0':s → 0':s → 0':s
iftimes :: true:false → 0':s → 0':s → 0':s
shorter :: cons:nil → 0':s → true:false
prod :: cons:nil → 0':s
if :: true:false → true:false → cons:nil → 0':s
if2 :: true:false → cons:nil → 0':s
hole_0':s1_0 :: 0':s
hole_cons:nil2_0 :: cons:nil
hole_true:false3_0 :: true:false
gen_0':s4_0 :: Nat → 0':s
gen_cons:nil5_0 :: Nat → cons:nil
Generator Equations:
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
gen_cons:nil5_0(0) ⇔ nil
gen_cons:nil5_0(+(x, 1)) ⇔ cons(0', gen_cons:nil5_0(x))
The following defined symbols remain to be analysed:
plus, times, shorter, prod
They will be analysed ascendingly in the following order:
plus < times
times < prod
shorter < prod
(7) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
plus(
gen_0':s4_0(
n7_0),
gen_0':s4_0(
b)) →
gen_0':s4_0(
+(
n7_0,
b)), rt ∈ Ω(1 + n7
0)
Induction Base:
plus(gen_0':s4_0(0), gen_0':s4_0(b)) →RΩ(1)
ifplus(isZero(gen_0':s4_0(0)), gen_0':s4_0(0), gen_0':s4_0(b)) →RΩ(1)
ifplus(true, gen_0':s4_0(0), gen_0':s4_0(b)) →RΩ(1)
gen_0':s4_0(b)
Induction Step:
plus(gen_0':s4_0(+(n7_0, 1)), gen_0':s4_0(b)) →RΩ(1)
ifplus(isZero(gen_0':s4_0(+(n7_0, 1))), gen_0':s4_0(+(n7_0, 1)), gen_0':s4_0(b)) →RΩ(1)
ifplus(false, gen_0':s4_0(+(1, n7_0)), gen_0':s4_0(b)) →RΩ(1)
s(plus(p(gen_0':s4_0(+(1, n7_0))), gen_0':s4_0(b))) →RΩ(1)
s(plus(gen_0':s4_0(n7_0), gen_0':s4_0(b))) →IH
s(gen_0':s4_0(+(b, c8_0)))
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(8) Complex Obligation (BEST)
(9) Obligation:
TRS:
Rules:
car(
cons(
x,
l)) →
xcddr(
nil) →
nilcddr(
cons(
x,
nil)) →
nilcddr(
cons(
x,
cons(
y,
l))) →
lcadr(
cons(
x,
cons(
y,
l))) →
yisZero(
0') →
trueisZero(
s(
x)) →
falseplus(
x,
y) →
ifplus(
isZero(
x),
x,
y)
ifplus(
true,
x,
y) →
yifplus(
false,
x,
y) →
s(
plus(
p(
x),
y))
times(
x,
y) →
iftimes(
isZero(
x),
x,
y)
iftimes(
true,
x,
y) →
0'iftimes(
false,
x,
y) →
plus(
y,
times(
p(
x),
y))
p(
s(
x)) →
xp(
0') →
0'shorter(
nil,
y) →
trueshorter(
cons(
x,
l),
0') →
falseshorter(
cons(
x,
l),
s(
y)) →
shorter(
l,
y)
prod(
l) →
if(
shorter(
l,
0'),
shorter(
l,
s(
0')),
l)
if(
true,
b,
l) →
s(
0')
if(
false,
b,
l) →
if2(
b,
l)
if2(
true,
l) →
car(
l)
if2(
false,
l) →
prod(
cons(
times(
car(
l),
cadr(
l)),
cddr(
l)))
Types:
car :: cons:nil → 0':s
cons :: 0':s → cons:nil → cons:nil
cddr :: cons:nil → cons:nil
nil :: cons:nil
cadr :: cons:nil → 0':s
isZero :: 0':s → true:false
0' :: 0':s
true :: true:false
s :: 0':s → 0':s
false :: true:false
plus :: 0':s → 0':s → 0':s
ifplus :: true:false → 0':s → 0':s → 0':s
p :: 0':s → 0':s
times :: 0':s → 0':s → 0':s
iftimes :: true:false → 0':s → 0':s → 0':s
shorter :: cons:nil → 0':s → true:false
prod :: cons:nil → 0':s
if :: true:false → true:false → cons:nil → 0':s
if2 :: true:false → cons:nil → 0':s
hole_0':s1_0 :: 0':s
hole_cons:nil2_0 :: cons:nil
hole_true:false3_0 :: true:false
gen_0':s4_0 :: Nat → 0':s
gen_cons:nil5_0 :: Nat → cons:nil
Lemmas:
plus(gen_0':s4_0(n7_0), gen_0':s4_0(b)) → gen_0':s4_0(+(n7_0, b)), rt ∈ Ω(1 + n70)
Generator Equations:
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
gen_cons:nil5_0(0) ⇔ nil
gen_cons:nil5_0(+(x, 1)) ⇔ cons(0', gen_cons:nil5_0(x))
The following defined symbols remain to be analysed:
times, shorter, prod
They will be analysed ascendingly in the following order:
times < prod
shorter < prod
(10) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
times(
gen_0':s4_0(
n1134_0),
gen_0':s4_0(
b)) →
gen_0':s4_0(
*(
n1134_0,
b)), rt ∈ Ω(1 + b·n1134
0 + n1134
0)
Induction Base:
times(gen_0':s4_0(0), gen_0':s4_0(b)) →RΩ(1)
iftimes(isZero(gen_0':s4_0(0)), gen_0':s4_0(0), gen_0':s4_0(b)) →RΩ(1)
iftimes(true, gen_0':s4_0(0), gen_0':s4_0(b)) →RΩ(1)
0'
Induction Step:
times(gen_0':s4_0(+(n1134_0, 1)), gen_0':s4_0(b)) →RΩ(1)
iftimes(isZero(gen_0':s4_0(+(n1134_0, 1))), gen_0':s4_0(+(n1134_0, 1)), gen_0':s4_0(b)) →RΩ(1)
iftimes(false, gen_0':s4_0(+(1, n1134_0)), gen_0':s4_0(b)) →RΩ(1)
plus(gen_0':s4_0(b), times(p(gen_0':s4_0(+(1, n1134_0))), gen_0':s4_0(b))) →RΩ(1)
plus(gen_0':s4_0(b), times(gen_0':s4_0(n1134_0), gen_0':s4_0(b))) →IH
plus(gen_0':s4_0(b), gen_0':s4_0(*(c1135_0, b))) →LΩ(1 + b)
gen_0':s4_0(+(b, *(n1134_0, b)))
We have rt ∈ Ω(n2) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n2).
(11) Complex Obligation (BEST)
(12) Obligation:
TRS:
Rules:
car(
cons(
x,
l)) →
xcddr(
nil) →
nilcddr(
cons(
x,
nil)) →
nilcddr(
cons(
x,
cons(
y,
l))) →
lcadr(
cons(
x,
cons(
y,
l))) →
yisZero(
0') →
trueisZero(
s(
x)) →
falseplus(
x,
y) →
ifplus(
isZero(
x),
x,
y)
ifplus(
true,
x,
y) →
yifplus(
false,
x,
y) →
s(
plus(
p(
x),
y))
times(
x,
y) →
iftimes(
isZero(
x),
x,
y)
iftimes(
true,
x,
y) →
0'iftimes(
false,
x,
y) →
plus(
y,
times(
p(
x),
y))
p(
s(
x)) →
xp(
0') →
0'shorter(
nil,
y) →
trueshorter(
cons(
x,
l),
0') →
falseshorter(
cons(
x,
l),
s(
y)) →
shorter(
l,
y)
prod(
l) →
if(
shorter(
l,
0'),
shorter(
l,
s(
0')),
l)
if(
true,
b,
l) →
s(
0')
if(
false,
b,
l) →
if2(
b,
l)
if2(
true,
l) →
car(
l)
if2(
false,
l) →
prod(
cons(
times(
car(
l),
cadr(
l)),
cddr(
l)))
Types:
car :: cons:nil → 0':s
cons :: 0':s → cons:nil → cons:nil
cddr :: cons:nil → cons:nil
nil :: cons:nil
cadr :: cons:nil → 0':s
isZero :: 0':s → true:false
0' :: 0':s
true :: true:false
s :: 0':s → 0':s
false :: true:false
plus :: 0':s → 0':s → 0':s
ifplus :: true:false → 0':s → 0':s → 0':s
p :: 0':s → 0':s
times :: 0':s → 0':s → 0':s
iftimes :: true:false → 0':s → 0':s → 0':s
shorter :: cons:nil → 0':s → true:false
prod :: cons:nil → 0':s
if :: true:false → true:false → cons:nil → 0':s
if2 :: true:false → cons:nil → 0':s
hole_0':s1_0 :: 0':s
hole_cons:nil2_0 :: cons:nil
hole_true:false3_0 :: true:false
gen_0':s4_0 :: Nat → 0':s
gen_cons:nil5_0 :: Nat → cons:nil
Lemmas:
plus(gen_0':s4_0(n7_0), gen_0':s4_0(b)) → gen_0':s4_0(+(n7_0, b)), rt ∈ Ω(1 + n70)
times(gen_0':s4_0(n1134_0), gen_0':s4_0(b)) → gen_0':s4_0(*(n1134_0, b)), rt ∈ Ω(1 + b·n11340 + n11340)
Generator Equations:
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
gen_cons:nil5_0(0) ⇔ nil
gen_cons:nil5_0(+(x, 1)) ⇔ cons(0', gen_cons:nil5_0(x))
The following defined symbols remain to be analysed:
shorter, prod
They will be analysed ascendingly in the following order:
shorter < prod
(13) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
shorter(
gen_cons:nil5_0(
n2790_0),
gen_0':s4_0(
n2790_0)) →
true, rt ∈ Ω(1 + n2790
0)
Induction Base:
shorter(gen_cons:nil5_0(0), gen_0':s4_0(0)) →RΩ(1)
true
Induction Step:
shorter(gen_cons:nil5_0(+(n2790_0, 1)), gen_0':s4_0(+(n2790_0, 1))) →RΩ(1)
shorter(gen_cons:nil5_0(n2790_0), gen_0':s4_0(n2790_0)) →IH
true
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(14) Complex Obligation (BEST)
(15) Obligation:
TRS:
Rules:
car(
cons(
x,
l)) →
xcddr(
nil) →
nilcddr(
cons(
x,
nil)) →
nilcddr(
cons(
x,
cons(
y,
l))) →
lcadr(
cons(
x,
cons(
y,
l))) →
yisZero(
0') →
trueisZero(
s(
x)) →
falseplus(
x,
y) →
ifplus(
isZero(
x),
x,
y)
ifplus(
true,
x,
y) →
yifplus(
false,
x,
y) →
s(
plus(
p(
x),
y))
times(
x,
y) →
iftimes(
isZero(
x),
x,
y)
iftimes(
true,
x,
y) →
0'iftimes(
false,
x,
y) →
plus(
y,
times(
p(
x),
y))
p(
s(
x)) →
xp(
0') →
0'shorter(
nil,
y) →
trueshorter(
cons(
x,
l),
0') →
falseshorter(
cons(
x,
l),
s(
y)) →
shorter(
l,
y)
prod(
l) →
if(
shorter(
l,
0'),
shorter(
l,
s(
0')),
l)
if(
true,
b,
l) →
s(
0')
if(
false,
b,
l) →
if2(
b,
l)
if2(
true,
l) →
car(
l)
if2(
false,
l) →
prod(
cons(
times(
car(
l),
cadr(
l)),
cddr(
l)))
Types:
car :: cons:nil → 0':s
cons :: 0':s → cons:nil → cons:nil
cddr :: cons:nil → cons:nil
nil :: cons:nil
cadr :: cons:nil → 0':s
isZero :: 0':s → true:false
0' :: 0':s
true :: true:false
s :: 0':s → 0':s
false :: true:false
plus :: 0':s → 0':s → 0':s
ifplus :: true:false → 0':s → 0':s → 0':s
p :: 0':s → 0':s
times :: 0':s → 0':s → 0':s
iftimes :: true:false → 0':s → 0':s → 0':s
shorter :: cons:nil → 0':s → true:false
prod :: cons:nil → 0':s
if :: true:false → true:false → cons:nil → 0':s
if2 :: true:false → cons:nil → 0':s
hole_0':s1_0 :: 0':s
hole_cons:nil2_0 :: cons:nil
hole_true:false3_0 :: true:false
gen_0':s4_0 :: Nat → 0':s
gen_cons:nil5_0 :: Nat → cons:nil
Lemmas:
plus(gen_0':s4_0(n7_0), gen_0':s4_0(b)) → gen_0':s4_0(+(n7_0, b)), rt ∈ Ω(1 + n70)
times(gen_0':s4_0(n1134_0), gen_0':s4_0(b)) → gen_0':s4_0(*(n1134_0, b)), rt ∈ Ω(1 + b·n11340 + n11340)
shorter(gen_cons:nil5_0(n2790_0), gen_0':s4_0(n2790_0)) → true, rt ∈ Ω(1 + n27900)
Generator Equations:
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
gen_cons:nil5_0(0) ⇔ nil
gen_cons:nil5_0(+(x, 1)) ⇔ cons(0', gen_cons:nil5_0(x))
The following defined symbols remain to be analysed:
prod
(16) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol prod.
(17) Obligation:
TRS:
Rules:
car(
cons(
x,
l)) →
xcddr(
nil) →
nilcddr(
cons(
x,
nil)) →
nilcddr(
cons(
x,
cons(
y,
l))) →
lcadr(
cons(
x,
cons(
y,
l))) →
yisZero(
0') →
trueisZero(
s(
x)) →
falseplus(
x,
y) →
ifplus(
isZero(
x),
x,
y)
ifplus(
true,
x,
y) →
yifplus(
false,
x,
y) →
s(
plus(
p(
x),
y))
times(
x,
y) →
iftimes(
isZero(
x),
x,
y)
iftimes(
true,
x,
y) →
0'iftimes(
false,
x,
y) →
plus(
y,
times(
p(
x),
y))
p(
s(
x)) →
xp(
0') →
0'shorter(
nil,
y) →
trueshorter(
cons(
x,
l),
0') →
falseshorter(
cons(
x,
l),
s(
y)) →
shorter(
l,
y)
prod(
l) →
if(
shorter(
l,
0'),
shorter(
l,
s(
0')),
l)
if(
true,
b,
l) →
s(
0')
if(
false,
b,
l) →
if2(
b,
l)
if2(
true,
l) →
car(
l)
if2(
false,
l) →
prod(
cons(
times(
car(
l),
cadr(
l)),
cddr(
l)))
Types:
car :: cons:nil → 0':s
cons :: 0':s → cons:nil → cons:nil
cddr :: cons:nil → cons:nil
nil :: cons:nil
cadr :: cons:nil → 0':s
isZero :: 0':s → true:false
0' :: 0':s
true :: true:false
s :: 0':s → 0':s
false :: true:false
plus :: 0':s → 0':s → 0':s
ifplus :: true:false → 0':s → 0':s → 0':s
p :: 0':s → 0':s
times :: 0':s → 0':s → 0':s
iftimes :: true:false → 0':s → 0':s → 0':s
shorter :: cons:nil → 0':s → true:false
prod :: cons:nil → 0':s
if :: true:false → true:false → cons:nil → 0':s
if2 :: true:false → cons:nil → 0':s
hole_0':s1_0 :: 0':s
hole_cons:nil2_0 :: cons:nil
hole_true:false3_0 :: true:false
gen_0':s4_0 :: Nat → 0':s
gen_cons:nil5_0 :: Nat → cons:nil
Lemmas:
plus(gen_0':s4_0(n7_0), gen_0':s4_0(b)) → gen_0':s4_0(+(n7_0, b)), rt ∈ Ω(1 + n70)
times(gen_0':s4_0(n1134_0), gen_0':s4_0(b)) → gen_0':s4_0(*(n1134_0, b)), rt ∈ Ω(1 + b·n11340 + n11340)
shorter(gen_cons:nil5_0(n2790_0), gen_0':s4_0(n2790_0)) → true, rt ∈ Ω(1 + n27900)
Generator Equations:
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
gen_cons:nil5_0(0) ⇔ nil
gen_cons:nil5_0(+(x, 1)) ⇔ cons(0', gen_cons:nil5_0(x))
No more defined symbols left to analyse.
(18) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n2) was proven with the following lemma:
times(gen_0':s4_0(n1134_0), gen_0':s4_0(b)) → gen_0':s4_0(*(n1134_0, b)), rt ∈ Ω(1 + b·n11340 + n11340)
(19) BOUNDS(n^2, INF)
(20) Obligation:
TRS:
Rules:
car(
cons(
x,
l)) →
xcddr(
nil) →
nilcddr(
cons(
x,
nil)) →
nilcddr(
cons(
x,
cons(
y,
l))) →
lcadr(
cons(
x,
cons(
y,
l))) →
yisZero(
0') →
trueisZero(
s(
x)) →
falseplus(
x,
y) →
ifplus(
isZero(
x),
x,
y)
ifplus(
true,
x,
y) →
yifplus(
false,
x,
y) →
s(
plus(
p(
x),
y))
times(
x,
y) →
iftimes(
isZero(
x),
x,
y)
iftimes(
true,
x,
y) →
0'iftimes(
false,
x,
y) →
plus(
y,
times(
p(
x),
y))
p(
s(
x)) →
xp(
0') →
0'shorter(
nil,
y) →
trueshorter(
cons(
x,
l),
0') →
falseshorter(
cons(
x,
l),
s(
y)) →
shorter(
l,
y)
prod(
l) →
if(
shorter(
l,
0'),
shorter(
l,
s(
0')),
l)
if(
true,
b,
l) →
s(
0')
if(
false,
b,
l) →
if2(
b,
l)
if2(
true,
l) →
car(
l)
if2(
false,
l) →
prod(
cons(
times(
car(
l),
cadr(
l)),
cddr(
l)))
Types:
car :: cons:nil → 0':s
cons :: 0':s → cons:nil → cons:nil
cddr :: cons:nil → cons:nil
nil :: cons:nil
cadr :: cons:nil → 0':s
isZero :: 0':s → true:false
0' :: 0':s
true :: true:false
s :: 0':s → 0':s
false :: true:false
plus :: 0':s → 0':s → 0':s
ifplus :: true:false → 0':s → 0':s → 0':s
p :: 0':s → 0':s
times :: 0':s → 0':s → 0':s
iftimes :: true:false → 0':s → 0':s → 0':s
shorter :: cons:nil → 0':s → true:false
prod :: cons:nil → 0':s
if :: true:false → true:false → cons:nil → 0':s
if2 :: true:false → cons:nil → 0':s
hole_0':s1_0 :: 0':s
hole_cons:nil2_0 :: cons:nil
hole_true:false3_0 :: true:false
gen_0':s4_0 :: Nat → 0':s
gen_cons:nil5_0 :: Nat → cons:nil
Lemmas:
plus(gen_0':s4_0(n7_0), gen_0':s4_0(b)) → gen_0':s4_0(+(n7_0, b)), rt ∈ Ω(1 + n70)
times(gen_0':s4_0(n1134_0), gen_0':s4_0(b)) → gen_0':s4_0(*(n1134_0, b)), rt ∈ Ω(1 + b·n11340 + n11340)
shorter(gen_cons:nil5_0(n2790_0), gen_0':s4_0(n2790_0)) → true, rt ∈ Ω(1 + n27900)
Generator Equations:
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
gen_cons:nil5_0(0) ⇔ nil
gen_cons:nil5_0(+(x, 1)) ⇔ cons(0', gen_cons:nil5_0(x))
No more defined symbols left to analyse.
(21) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n2) was proven with the following lemma:
times(gen_0':s4_0(n1134_0), gen_0':s4_0(b)) → gen_0':s4_0(*(n1134_0, b)), rt ∈ Ω(1 + b·n11340 + n11340)
(22) BOUNDS(n^2, INF)
(23) Obligation:
TRS:
Rules:
car(
cons(
x,
l)) →
xcddr(
nil) →
nilcddr(
cons(
x,
nil)) →
nilcddr(
cons(
x,
cons(
y,
l))) →
lcadr(
cons(
x,
cons(
y,
l))) →
yisZero(
0') →
trueisZero(
s(
x)) →
falseplus(
x,
y) →
ifplus(
isZero(
x),
x,
y)
ifplus(
true,
x,
y) →
yifplus(
false,
x,
y) →
s(
plus(
p(
x),
y))
times(
x,
y) →
iftimes(
isZero(
x),
x,
y)
iftimes(
true,
x,
y) →
0'iftimes(
false,
x,
y) →
plus(
y,
times(
p(
x),
y))
p(
s(
x)) →
xp(
0') →
0'shorter(
nil,
y) →
trueshorter(
cons(
x,
l),
0') →
falseshorter(
cons(
x,
l),
s(
y)) →
shorter(
l,
y)
prod(
l) →
if(
shorter(
l,
0'),
shorter(
l,
s(
0')),
l)
if(
true,
b,
l) →
s(
0')
if(
false,
b,
l) →
if2(
b,
l)
if2(
true,
l) →
car(
l)
if2(
false,
l) →
prod(
cons(
times(
car(
l),
cadr(
l)),
cddr(
l)))
Types:
car :: cons:nil → 0':s
cons :: 0':s → cons:nil → cons:nil
cddr :: cons:nil → cons:nil
nil :: cons:nil
cadr :: cons:nil → 0':s
isZero :: 0':s → true:false
0' :: 0':s
true :: true:false
s :: 0':s → 0':s
false :: true:false
plus :: 0':s → 0':s → 0':s
ifplus :: true:false → 0':s → 0':s → 0':s
p :: 0':s → 0':s
times :: 0':s → 0':s → 0':s
iftimes :: true:false → 0':s → 0':s → 0':s
shorter :: cons:nil → 0':s → true:false
prod :: cons:nil → 0':s
if :: true:false → true:false → cons:nil → 0':s
if2 :: true:false → cons:nil → 0':s
hole_0':s1_0 :: 0':s
hole_cons:nil2_0 :: cons:nil
hole_true:false3_0 :: true:false
gen_0':s4_0 :: Nat → 0':s
gen_cons:nil5_0 :: Nat → cons:nil
Lemmas:
plus(gen_0':s4_0(n7_0), gen_0':s4_0(b)) → gen_0':s4_0(+(n7_0, b)), rt ∈ Ω(1 + n70)
times(gen_0':s4_0(n1134_0), gen_0':s4_0(b)) → gen_0':s4_0(*(n1134_0, b)), rt ∈ Ω(1 + b·n11340 + n11340)
Generator Equations:
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
gen_cons:nil5_0(0) ⇔ nil
gen_cons:nil5_0(+(x, 1)) ⇔ cons(0', gen_cons:nil5_0(x))
No more defined symbols left to analyse.
(24) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n2) was proven with the following lemma:
times(gen_0':s4_0(n1134_0), gen_0':s4_0(b)) → gen_0':s4_0(*(n1134_0, b)), rt ∈ Ω(1 + b·n11340 + n11340)
(25) BOUNDS(n^2, INF)
(26) Obligation:
TRS:
Rules:
car(
cons(
x,
l)) →
xcddr(
nil) →
nilcddr(
cons(
x,
nil)) →
nilcddr(
cons(
x,
cons(
y,
l))) →
lcadr(
cons(
x,
cons(
y,
l))) →
yisZero(
0') →
trueisZero(
s(
x)) →
falseplus(
x,
y) →
ifplus(
isZero(
x),
x,
y)
ifplus(
true,
x,
y) →
yifplus(
false,
x,
y) →
s(
plus(
p(
x),
y))
times(
x,
y) →
iftimes(
isZero(
x),
x,
y)
iftimes(
true,
x,
y) →
0'iftimes(
false,
x,
y) →
plus(
y,
times(
p(
x),
y))
p(
s(
x)) →
xp(
0') →
0'shorter(
nil,
y) →
trueshorter(
cons(
x,
l),
0') →
falseshorter(
cons(
x,
l),
s(
y)) →
shorter(
l,
y)
prod(
l) →
if(
shorter(
l,
0'),
shorter(
l,
s(
0')),
l)
if(
true,
b,
l) →
s(
0')
if(
false,
b,
l) →
if2(
b,
l)
if2(
true,
l) →
car(
l)
if2(
false,
l) →
prod(
cons(
times(
car(
l),
cadr(
l)),
cddr(
l)))
Types:
car :: cons:nil → 0':s
cons :: 0':s → cons:nil → cons:nil
cddr :: cons:nil → cons:nil
nil :: cons:nil
cadr :: cons:nil → 0':s
isZero :: 0':s → true:false
0' :: 0':s
true :: true:false
s :: 0':s → 0':s
false :: true:false
plus :: 0':s → 0':s → 0':s
ifplus :: true:false → 0':s → 0':s → 0':s
p :: 0':s → 0':s
times :: 0':s → 0':s → 0':s
iftimes :: true:false → 0':s → 0':s → 0':s
shorter :: cons:nil → 0':s → true:false
prod :: cons:nil → 0':s
if :: true:false → true:false → cons:nil → 0':s
if2 :: true:false → cons:nil → 0':s
hole_0':s1_0 :: 0':s
hole_cons:nil2_0 :: cons:nil
hole_true:false3_0 :: true:false
gen_0':s4_0 :: Nat → 0':s
gen_cons:nil5_0 :: Nat → cons:nil
Lemmas:
plus(gen_0':s4_0(n7_0), gen_0':s4_0(b)) → gen_0':s4_0(+(n7_0, b)), rt ∈ Ω(1 + n70)
Generator Equations:
gen_0':s4_0(0) ⇔ 0'
gen_0':s4_0(+(x, 1)) ⇔ s(gen_0':s4_0(x))
gen_cons:nil5_0(0) ⇔ nil
gen_cons:nil5_0(+(x, 1)) ⇔ cons(0', gen_cons:nil5_0(x))
No more defined symbols left to analyse.
(27) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
plus(gen_0':s4_0(n7_0), gen_0':s4_0(b)) → gen_0':s4_0(+(n7_0, b)), rt ∈ Ω(1 + n70)
(28) BOUNDS(n^1, INF)